Index

api/v1/jobs/{jobno}/timers

Path: api/v1/jobs/{jobno}/timers

This API is JSON:API compliant.

This endpoint supports the following methods:
GET POST PATCH

The resource type for this endpoint is JobTimer
The identifier is jobno-refno

The JobTimer resource type attributes are as follows:

{
"LabourInit":string
"Comment":string
"LabourType":string
Must be left out or null when creating a timer. Otherwise may be Paused, Resumed, or Stopped. Note once stopped the timer will cease to exist (it become a simple labour entry on the job).
optional
"State":string
"LineNum":integer
}

Example GET (Return specific)

Path: api/v1/jobs/10/timers/10-1

Response:

{
  "data": {
    "id": "10-1",
    "type": "JobTimer",
    "attributes": {
      "LabourInit": null,
      "Comment": "",
      "LabourType": "Admin",
      "State": "Resumed",
      "LineNum": 2
    },
    "links": {
      "self": "/api/v1/jobs/10/timers/10-1"
    }
  }
}

Example POST

Path: api/v1/jobs/10/timers

Request:

{
    "data": {
        "type": "JobTimer",
        "attributes": {
            "LabourInit": "SYS",
            "Comment": "Test",
            "LabourType": "Admin",
            "LineNum": 1
        }
    }
}

Response:

{
    "data": {
        "id": "10-3",
        "type": "JobTimer",
        "attributes": {
            "LabourInit": "SYS",
            "Comment": "Test",
            "LabourType": "Admin",
            "State": "Resumed",
            "LineNum": 3
        },
      "links": {
        "self": "/api/v1/jobs/10/timers/10-3"
      }
    }
}

Example PATCH

Path: api/v1/jobs/10/timers/10-1

Request:

{
    "data": {
        "id": "1",        
        "type": "JobTimer",
        "attributes": {
            "LabourInit": "SYS",
            "Comment": "Test",
            "LabourType": "Admin",
            "State": "Resumed",
            "LineNum": 1
        }
    }
}

Response:

{
  "data": {
    "id": "10-1",
    "type": "JobTimer",
    "attributes": {
      "LabourInit": "SYS",
      "Comment": "Test",
      "LabourType": "Admin",
      "State": "Resumed",
      "LineNum": 1
    },
    "links": {
      "self": "/api/v1/jobs/10/timers/10-1"
    }
  }
}